 {layout name="common/layout" /}

<style>
	.btn {
		width: 90px;
		height: 30px;
		line-height: 30px !important;
		margin: 0;
		padding: 0;
		margin-bottom: 10px;
		text-align: center;
		color: #fff;
		font-size: 14px;
		border-radius: 5px;
	}

	.box-btn {
		width: 180px;
		text-align: center;
		display: block;
		border-radius: 5px;
		margin: 20px 0;
	}

	.rules-btn {
		font-size: 15px;
		margin: 0 20px;
		color: #2196f3;
	}

	.rules-btn:hover {
		color: #2196f3;
	}
</style>

<div class="dislpayArrow hidden-xs"><a class="pngfix" href="javascript:void(0);" onClick="displaynavbar(this)"></a></div>

<div class="Hui-article-box" style="margin-top: 37px;">
	<div class="newCrumbs ">租赁规则/合约模板
	</div>
	<div class="Hui-article">
		<div>

			<div style="float: right;"><a class="box-btn" href="{:url('leasingrules/create')}">添加租赁规则/合约模板</a></div>
		</div>
		<div>
			<table class="table table-border table-bg  table-bordered" style="background:#f9f9f9">
				<tr class="text-c" style="background:#f3f3f3">
					<th>名称</th>
					<th width="450px;">创建时间</th>
					<th>操作</th>
				</tr>
				{foreach($data as $k => $v)}
				<tr style="height: 90px;" class="text-c">
					<td>{$v['leasing_rules_name']}</td>
					<td>{$v['leasing_rules_create_time']}</td>
					<td><a href="{:url('leasingrules/update', ['id'=>$v['leasing_rules_id']])}" class="rules-btn">修改</a><a href="javascript:void(0);"
						    class="rules-btn" onclick="del({$v['leasing_rules_id']}, {:session('merchant')['merchant_id']});">删除</a></td>
				</tr>
				{/foreach}
			</table>
			<div class="cl">
				{$data->render()} </div>
		</div>
	</div>
</div>

<script>
	$(function () {
		$.Huitab("#tab_demo .tabBar span", "#tab_demo .tabCon", "current", "click", "0")
	});
	var GG = {
		"kk": function (mm) {
			var ym = mm;
		}
	}
	$(".paginate").initPage(71, 1, GG.kk);



	function del(id) {
		layer.msg('你确定要删除吗？', {
			time: 0,
			btn: ['确定', '取消'],
			area: ['250px', '120px'],
			btnAlign: 'c',
			yes: function (index) {
				layer.close(index);
				$.ajax({
					type: 'get',
					url: "<?php echo url('leasingrules/delete', '', false); ?>/id/" + id,
					dataType: 'json',
					success: function (data) {
						layer.msg(data.msg, {
							offset: 't',
							anim: 5,
							success: function () {
								location.reload();
							}
						});
					}
				});
			}
		});

	}
</script>